
<?php Yii::app()->clientScript->registerScript('employeecontact',<<<HERE
    var category="$category->id";
    Ext.onReady(function(){
        var store=Ext.create('Ext.data.Store',{
            model:'Invsubcategories',
            pageSize:20,
            autoLoad:true,
            proxy:{
                type:'ajax',
                url:'index.php?r=invsubcategories/list&category='+category,
                reader:{
                    type:'json',
                    root:'data',
                    totalProperty:'totalCount'
                }
            }
        })
        Ext.create('Ext.ux.LiveSearchGridPanel',{
            store:store,
            height: 450,
            width: grid_width,
            title: 'Sub-Categories List',
            renderTo: 'categories-list',
            viewConfig: {
                stripeRows: true
            },
          
            bbar: new Ext.PagingToolbar({
                pageSize: 20,
                store:store,
                displayInfo: true,
                displayMsg: 'Displaying topics {0} - {1} of {2}',
                emptyMsg: 'No topics to display'

            }),
            columns:[
                {
                    text:'Sub-Category',
                    flex:1,
                    dataIndex:'subcategory',
                    renderer:function(value,p,record){
                        return Ext.String.format('<a href="index.php?r=invsubcategories/update&id={0}">{1}</a>',record.data.id,record.data.subcategory);
                    }
                },
                {
                    text:'Category',
                    flex:1,
                    dataIndex:'categoryText'
                },
                
                {
                    text:'Apply Makup',
                    flex:1,
                    dataIndex:'applymarkup'
                },
                {
                    text:'Makup Code',
                    flex:1,
                    dataIndex:'markupcode'
                },
                {
                    text:'Price Book',
                    flex:1,
                    dataIndex:'pricebook'
                },
                {
                    text:'Status',
                    flex:1,
                    dataIndex:'statusText'
                },
              
                {
                    text:'Actions',
                    flex:1,
                    renderer:function(value,p,record){
                        return Ext.String.format('<a href="index.php?r=invsubcategories/update&id={0}"><img src="images/update.png"/></a><a href="index.php?r=invsubcategories/delete&id={0}"><img src="images/delete.png"/></a>',record.data.id);
                    }
                }
            ]

        });
    });
HERE
        ,CClientScript::POS_BEGIN);?>


<div id="left-col">
    <?php $this->renderPartial('_side',array(
        'model'=>$category
    ));?>
</div>

<div id="right-col">

    <div class="wrap">
        <div class="container">

            
            
            <div class="inside">
            <?php $this->renderPartial('/invcategories/_tab',array(
                'model'=>$category
            ));?> 
                 <br/>
       
                <div id="categories-list"></div>


                
            </div><!-- inside -->
        </div><!-- container -->
    </div><!-- wrap -->
    <?php $this->renderPartial('/copyright'); ?>
</div> <!-- left-col -->